package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallUserUtm;
import com.appkubes.mall.core.po.MallUserUtmExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallUserUtmMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_utm
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUserUtmSqlProvider.class, method="countByExample")
    long countByExample(MallUserUtmExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_utm
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallUserUtmSqlProvider.class, method="deleteByExample")
    int deleteByExample(MallUserUtmExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_utm
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_user_utm",
        "where user_key = #{userKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String userKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_utm
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_user_utm (user_key, app_key, ",
        "utm_source, register_ip, ",
        "platform_type, flex_type, ",
        "flex_segment1, flex_segment2, ",
        "flex_segment3, version)",
        "values (#{userKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{utmSource,jdbcType=VARCHAR}, #{registerIp,jdbcType=VARCHAR}, ",
        "#{platformType,jdbcType=VARCHAR}, #{flexType,jdbcType=VARCHAR}, ",
        "#{flexSegment1,jdbcType=VARCHAR}, #{flexSegment2,jdbcType=VARCHAR}, ",
        "#{flexSegment3,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER})"
    })
    int insert(MallUserUtm record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_utm
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallUserUtmSqlProvider.class, method="insertSelective")
    int insertSelective(MallUserUtm record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_utm
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUserUtmSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="utm_source", property="utmSource", jdbcType=JdbcType.VARCHAR),
        @Result(column="register_ip", property="registerIp", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_type", property="platformType", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_type", property="flexType", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment1", property="flexSegment1", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment2", property="flexSegment2", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment3", property="flexSegment3", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallUserUtm> selectByExampleWithRowbounds(MallUserUtmExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_utm
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUserUtmSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="utm_source", property="utmSource", jdbcType=JdbcType.VARCHAR),
        @Result(column="register_ip", property="registerIp", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_type", property="platformType", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_type", property="flexType", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment1", property="flexSegment1", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment2", property="flexSegment2", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment3", property="flexSegment3", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallUserUtm> selectByExample(MallUserUtmExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_utm
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "user_key, app_key, utm_source, register_ip, platform_type, flex_type, flex_segment1, ",
        "flex_segment2, flex_segment3, version",
        "from mall_user_utm",
        "where user_key = #{userKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="utm_source", property="utmSource", jdbcType=JdbcType.VARCHAR),
        @Result(column="register_ip", property="registerIp", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_type", property="platformType", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_type", property="flexType", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment1", property="flexSegment1", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment2", property="flexSegment2", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment3", property="flexSegment3", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    MallUserUtm selectByPrimaryKey(String userKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_utm
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUserUtmSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallUserUtm record, @Param("example") MallUserUtmExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_utm
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUserUtmSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallUserUtm record, @Param("example") MallUserUtmExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_utm
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUserUtmSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallUserUtm record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_utm
     *
     * @mbg.generated
     */
    @Update({
        "update mall_user_utm",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "utm_source = #{utmSource,jdbcType=VARCHAR},",
          "register_ip = #{registerIp,jdbcType=VARCHAR},",
          "platform_type = #{platformType,jdbcType=VARCHAR},",
          "flex_type = #{flexType,jdbcType=VARCHAR},",
          "flex_segment1 = #{flexSegment1,jdbcType=VARCHAR},",
          "flex_segment2 = #{flexSegment2,jdbcType=VARCHAR},",
          "flex_segment3 = #{flexSegment3,jdbcType=VARCHAR},",
          "version = #{version,jdbcType=INTEGER}",
        "where user_key = #{userKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallUserUtm record);
}